home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 17 January 97
- // Author: jb
- //
- //
- // Procedure Name:
- // shuffleManipHandleIndex
- //
- // Description:
- //
- // Allows user to cycle through the handles on
- // the transformation manips, both forwards and
- // backwards. Passing in 1 indexes up, and -1
- // indexes down. Could be extended to other
- // manip types, if they gain the ability to set
- // their active handles.
- //
- // Input Arguments:
- // -next
- // -previous
- //
- // Return Value:
- // None.
- //
-
- global proc shuffleManipHandleIndex( string $shuffle )
- {
- global string $gMove, $gRotate, $gScale;
- //
- // Get the current context
- //
- string $currentCtx = `currentCtx`;
- string $cmdString;
- int $increment;
-
- if( $shuffle == "-next" ) {
- $increment = 1;
- } else {
- $increment = -1;
- }
-
- if( $currentCtx == $gMove ) {
- if (`superCtx -q $gMove` != "Move") return;
- //
- // Get the currently active handle on
- // the move context
- //
- int $newAH = `manipMoveContext -q -ah Move`;
- $newAH = ( $newAH + $increment );
- if( $newAH == 4 ) {
- //
- // Index is greater than 4, so set
- // it back to 0 to allow cycling
- //
- $newAH = 0;
- }
- if( $newAH == -1 ) {
- //
- // Index is less than 0, so set it
- // back to 3 to allow cycling
- //
- $newAH = 3;
- }
- // Build the command string to execute to change the active
- // manip handle
- //
- $cmdString = ( "manipMoveContext -e -ah "+$newAH+" Move" );
- eval $cmdString;
- return;
- }
- if( $currentCtx == "Rotate" ) {
- //
- // Get the currently active handle on
- // the rotate context
- //
- int $newAH = `manipRotateContext -q -ah $currentCtx`;
- $newAH = ( $newAH + $increment );
- if( $newAH == 3 ) {
- //
- // Index is greater than 2, so set
- // it back to 0 to allow cycling - note
- // that the screen aligned handle is
- // being filtered out here - set this
- // to 4 to get the screen aligned handle
- // included in the cycling.
- //
- $newAH = 0;
- }
- if( $newAH == -1 ) {
- //
- // Index is less than 0, so set it
- // back to 2 to allow cycling
- //
- $newAH = 2;
- }
- // Build the command string to execute to change the active
- // manip handle
- //
- $cmdString = ( "manipRotateContext -e -ah "+$newAH+" "+$currentCtx );
- eval $cmdString;
- return;
- }
- if( $currentCtx == $gScale ) {
- if (`superCtx -q $gScale` != "Scale") return;
- //
- // Get the currently active handle on
- // the scale context
- //
- int $newAH = `manipScaleContext -q -ah "Scale"`;
- $newAH = ( $newAH + $increment );
- if( $newAH == 4 ) {
- //
- // Index is greater than 4, so set
- // it back to 0 to allow cycling
- //
- $newAH = 0;
- }
- if( $newAH == -1 ) {
- //
- // Index is less than 0, so set it
- // back to 3 to allow cycling
- //
- $newAH = 3;
- }
- // Build the command string to execute to change the active
- // manip handle
- //
- $cmdString = ( "manipScaleContext -e -ah "+$newAH+" Scale" );
- eval $cmdString;
- return;
- }
- }
-
-
-